home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
boot
/
czesc_2
/
snap
/
frame.c
< prev
next >
Wrap
Text File
|
1995-09-04
|
1KB
|
67 lines
IMPORT struct RastPort rp;
Point OldFrame[9];
Point NewFrame[9];
LONG OFType = 0;
UWORD Ptrn;
STATIC VOID MultiDraw( struct RastPort *rp, LONG num, Point *xy)
{
REGISTER LONG i = 0;
REGISTER Point *coord = xy;
while (i < num)
{
Move(rp, (LONG) coord->x, (LONG) coord->y);
coord++;
Draw(rp, (LONG) coord->x, (LONG) coord->y);
i++;
}
}
VOID crawl_frame( LONG dir)
{
REGISTER UWORD temp = Ptrn;
if (dir)
{
Ptrn = ((Ptrn << 1) & 0xfffe) | ((Ptrn & 0x8000) >> 15);
}
else
{
Ptrn = ((Ptrn >> 1) & 0x7fff) | ((Ptrn & 1) << 15);
}
temp ^= Ptrn;
SetDrPt(&rp, temp);
MultiDraw(&rp, OFType, &OldFrame[0]);
SetDrPt(&rp, Ptrn);
}
VOID erase_frame( void)
{
if (OFType)
{
MultiDraw(&rp, OFType, &OldFrame[0]);
OFType = 0;
}
}
VOID draw_frame( LONG ft)
{
REGISTER LONG i;
/* Remove old frame */
WaitTOF();
erase_frame();
/* Draw the new frame */
SetDrPt(&rp, Ptrn);
MultiDraw(&rp, ft, &NewFrame[0]);
/* save the frame for erasing later */
for (i = 0; i <= ft; i++)
{
OldFrame[i].x = NewFrame[i].x;
OldFrame[i].y = NewFrame[i].y;
}
OFType = ft;
}